package ru.spb.nicetu.altx.mnemo.cell;

@SuppressWarnings("serial")
public class NodeCell implements INodeCell {

  private String name;
  private String valueClassName;
  private Categories category;
  private String IDCell;

  public NodeCell(String IDCell, String name, String valueClassName,
                  Categories category) {
    this.IDCell = IDCell;
    this.name = name;
    this.valueClassName = valueClassName;
    this.category = category;
  }

  
  public String getName() {
    return this.name;
  }

  
  public String getValueClassName() {
    return this.valueClassName;
  }

  
  public String getValueTypeName() {
    return getValueClassName();
  }

  
  public Categories getCategorie() {
    return this.category;
  }

  
  public boolean isInput() {
    return this.category == Categories.INPUT;
  }

  
  public boolean isOuput() {
    return this.category == Categories.OUTPUT;
  }

  
  public boolean isSetting() {
    return this.category == Categories.SETTING;
  }

  
  public INodeCell clone() {
    return new NodeCell(this.IDCell, this.name, this.valueClassName,
        this.category);
  }

  
  public boolean equals(Object o) {
    if (o == null)
      return false;
    if (getClass() != o.getClass())
      return false;
    INodeCell other = (INodeCell) o;
    return getName().equals(other.getName()) &&
        getValueClassName().equals(other.getValueClassName()) &&
        getCategorie().equals(other.getCategorie());
  }

  
  public int hashCode() {
    int hash;
    hash = getName().hashCode() + 135 * getValueClassName().hashCode() + 137 *
        category.hashCode();

    return hash;
  }

  
  public String getCellID() {
    return IDCell;
  }

  
  public void setCellID(String IDCell) {
    this.IDCell = IDCell;
  }

}
